package com.jxlc.framework.oauth2.domain.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.jxlc.framework.oauth2.enums.LoginType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Set;

/**
 * OAuth2 刷新令牌
 *
 * @author 圣钰科技
 */
@Data
@Accessors(chain = true)
public class RefreshTokenDto {

    public RefreshTokenDto(LoginType loginType, Integer expiresTime){
        this.loginType = loginType;
        this.expiresTime = expiresTime;
    }

    /**
     * 用户编号
     */
    private Long userId;
    /**
     * 用户类型
     *
     */
    private LoginType loginType;
    /**
     * 客户端编号
     *
     */
    private Long clientId;
    /**
     * 授权范围
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Set<String> scopes;
    /**
     * 过期时间
     */
    private Integer expiresTime;

}
